#ifndef CONSUMER_MODULE_H
#define CONSUMER_MODULE_H

#include<string>
#include<vector>
#include<map>

// 消费者类
class Consumer {
public:
    Consumer(int user_id, std::string phone, std::string password, std::string nickname = "")
        : user_id(user_id), phone(phone), password(password), nickname(nickname) {}

    int getUserID() const { return user_id; }
    std::string getPhone() const { return phone; }
    std::string getPassword() const { return password; }
    std::string getNickname() const { return nickname; }

    void setNickname(const std::string& nickname) { this->nickname = nickname; }
    void setPhone(const std::string& phone) { this->phone = phone; }
    void setPassword(const std::string& password) { this->password = password; }

private:
    int user_id;
    std::string phone;
    std::string password;
    std::string nickname;
};

// 消费者模块类
class ConsumerModule {
public:
    ConsumerModule() {}

    bool addAddress(int user_id, const std::string& address);
    bool updateAddress(int user_id, const std::string& address);
    bool deleteAddress(int user_id);
    bool viewAddresses(int user_id, std::string& userAddr);

private:
    // 模拟地址数据库
    std::map<int, std::string> addresses;
};

#endif // CONSUMER_MODULE_H